package com.ecity.ui {
	import flash.display.Bitmap;
	import flash.display.GradientType;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.geom.Matrix;
	
	/**
	 * ...
	 * @author Yicheng.Zhang
	 */
	public class Menu extends Sprite {
		protected var bgColors:Array = [0x0b162e, 0x122a69];//0x122a69
		protected var borderColors:Array = [0x112459, 0x1d448d, 0x112459];//0x122a69
		//0x0b1838,0x030922,0x0d1c4b
		protected var alphas:Array = [0, 0];
		protected var ratios:Array = [0, 255];
		protected var matrix:Matrix = new Matrix();
		
		protected var menuWidth:int;
		protected var menuHeight:int;
		protected var isExpland:Boolean;
		protected var border:Sprite;
		
		protected var faceLength:int;
		protected var displayFace:Bitmap;
		protected var faces:Array;
		protected var level:int;
		
		public function Menu(){
			this.menuWidth = 283;
			border = new Sprite();
		}
		
		protected function drawBackground():void {
			this.graphics.beginGradientFill(GradientType.LINEAR, bgColors, alphas, ratios,matrix);
			this.graphics.drawRect(0, 0, menuWidth, menuHeight);
			this.graphics.endFill();
		}
		
		protected function addBmpText(bitmap:Bitmap, bx:int, by:int):void {
			bitmap.x = bx;
			bitmap.y = by;
			this.addChildAt(bitmap,0);
		}
		
		protected function addShineBorder(bx:int, by:int):void {
			var border:ShiningBorder = new ShiningBorder(150, 2, borderColors, alphas, ratios, matrix)
			border.x = bx;
			border.y = by;
			this.addChild(border);
		}
		
		public function addMEListener():void {
			this.addEventListener(MouseEvent.MOUSE_OVER, onHover);
			this.addEventListener(MouseEvent.CLICK, onClicking);
			this.addEventListener(MouseEvent.MOUSE_OUT, onSelected);
		}
		
		
		public function onHover(e:MouseEvent):void{
			
		}
		
		public function onClicking(e:MouseEvent):void{
			
		}
		
		public function onSelected(e:MouseEvent):void{
			
		}
	}

}